From a5a8a98d1f5159828848678b45c6cee47d9bc6eb Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 24 May 2005 10:12:12 +0000 Subject: [PATCH] bitkeeper revision 1.1528 (4292fdfc5zZkxl3RcxrdBZCU6Rd8EA) XendDomain.py: Handle error case where exec fails. xpopen.py: Exit with 127 if exec fails. Signed-off-by: Christian Limpach --- tools/python/xen/util/xpopen.py | 2 +- tools/python/xen/xend/XendDomain.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/util/xpopen.py b/tools/python/xen/util/xpopen.py index 78bbefdd2c..b0c880fafe 100644 --- a/tools/python/xen/util/xpopen.py +++ b/tools/python/xen/util/xpopen.py @@ -129,7 +129,7 @@ class xPopen3: try: os.execvp(cmd[0], cmd) finally: - os._exit(1) + os._exit(127) def poll(self): """Return the exit status of the child process if it has finished, diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 2320e8758d..2df4f48d97 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -392,6 +392,8 @@ class XendDomain: if filter(lambda (fd, event): event & select.POLLHUP, r): break + if child.wait() >> 8 == 127: + lasterr = "popen %s failed" % PATH_XC_RESTORE if child.wait() != 0: raise XendError("xc_restore failed: %s" % lasterr) -- 2.30.2